package com.idp.ebay.domain;

import java.util.Date;
import java.text.SimpleDateFormat;

import com.idp.ebay.annotation.ExcelAnnotation;

public class EBayInfo {
	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "订单号")
	private String orderId;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "购买人ID")
	private String buyerId;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "订单状态")
	private String orderStatus;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "支付状态")
	private String checkoutStatus;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "金额小记")
	private String subTotal;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "金额总计")
	private String total;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "支付方式")
	private String paymethod;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "发货时间")
	private String shiptime;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "物流名称")
	private String shiptype;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "收件人")
	private String shipname;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "收件地址")
	private String shipAddress;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "邮编")
	private String postalCode;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "手机号")
	private String phone;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "订单创建时间")
	private String createTime;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "商品 ID")
	private String transactionId;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "商品名称 ")
	private String productTitle;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "eBay Item id")
	private String itemId;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "SKU")
	private String sku;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "支付金额")
	private String paid;

	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "购买数量")
	private String quanity;
	
	
	@SuppressWarnings("unused")
	@ExcelAnnotation(name = "购买商品件数")
	private String transactionLength;

	private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public EBayInfo() {
		super();
	}

	public EBayInfo(String orderId, String buyerId, String orderStatus, String checkoutStatus, String subTotal,
			String total, String paymethod, String shiptime, String shiptype, String shipname, String shipAddress,
			String postalCode, String phone, String createTime, String transactionId, String productTitle,
			String itemId, String sku, String paid, String quanity) {
		super();
		this.orderId = orderId;
		this.buyerId = buyerId;
		this.orderStatus = orderStatus;
		this.checkoutStatus = checkoutStatus;
		this.subTotal = subTotal;
		this.total = total;
		this.paymethod = paymethod;
		this.shiptime = shiptime;
		this.shiptype = shiptype;
		this.shipname = shipname;
		this.shipAddress = shipAddress;
		this.postalCode = postalCode;
		this.phone = phone;
		this.createTime = createTime;
		this.transactionId = transactionId;
		this.productTitle = productTitle;
		this.itemId = itemId;
		this.sku = sku;
		this.paid = paid;
		this.quanity = quanity;
	}
	
	
	
	

	public EBayInfo(String orderId, String buyerId, String orderStatus, String checkoutStatus, String subTotal,
			String total, String paymethod, String shiptime, String shiptype, String shipname, String shipAddress,
			String postalCode, String phone, String createTime, String transactionId, String productTitle,
			String itemId, String sku, String paid, String quanity, String transactionLength) {
		super();
		this.orderId = orderId;
		this.buyerId = buyerId;
		this.orderStatus = orderStatus;
		this.checkoutStatus = checkoutStatus;
		this.subTotal = subTotal;
		this.total = total;
		this.paymethod = paymethod;
		this.shiptime = shiptime;
		this.shiptype = shiptype;
		this.shipname = shipname;
		this.shipAddress = shipAddress;
		this.postalCode = postalCode;
		this.phone = phone;
		this.createTime = createTime;
		this.transactionId = transactionId;
		this.productTitle = productTitle;
		this.itemId = itemId;
		this.sku = sku;
		this.paid = paid;
		this.quanity = quanity;
		this.transactionLength = transactionLength;
	}

	public String getTransactionLength() {
		return transactionLength;
	}

	public void setTransactionLength(String transactionLength) {
		this.transactionLength = transactionLength;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getBuyerId() {
		return buyerId;
	}

	public void setBuyerId(String buyerId) {
		this.buyerId = buyerId;
	}

	public String getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(String orderStatus) {
		this.orderStatus = orderStatus;
	}

	public String getCheckoutStatus() {
		return checkoutStatus;
	}

	public void setCheckoutStatus(String checkoutStatus) {
		this.checkoutStatus = checkoutStatus;
	}

	public String getSubTotal() {
		return subTotal;
	}

	public void setSubTotal(String subTotal) {
		this.subTotal = subTotal;
	}

	public String getTotal() {
		return total;
	}

	public void setTotal(String total) {
		this.total = total;
	}

	public String getPaymethod() {
		return paymethod;
	}

	public void setPaymethod(String paymethod) {
		this.paymethod = paymethod;
	}

	public String getShiptime() {

		String returnstr = null;

		if (shiptime.equals("未发货")) {
			returnstr = "未发货";
		} else {
			long date = Date.parse(shiptime);
			returnstr = simpleDateFormat.format(date);
		}
		
		return returnstr;
	}

	public void setShiptime(String shiptime) {
		this.shiptime = shiptime;
	}

	public String getShiptype() {
		return shiptype;
	}

	public void setShiptype(String shiptype) {
		this.shiptype = shiptype;
	}

	public String getShipname() {
		return shipname;
	}

	public void setShipname(String shipname) {
		this.shipname = shipname;
	}

	public String getShipAddress() {
		return shipAddress;
	}

	public void setShipAddress(String shipAddress) {
		this.shipAddress = shipAddress;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getCreateTime() {
		long date = Date.parse(createTime);

		return simpleDateFormat.format(date);
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getTransactionId() {
		return transactionId;
	}

	public void setTransactionId(String transactionId) {
		this.transactionId = transactionId;
	}

	public String getProductTitle() {
		return productTitle;
	}

	public void setProductTitle(String productTitle) {
		this.productTitle = productTitle;
	}

	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	public String getSku() {
		return sku;
	}

	public void setSku(String sku) {
		this.sku = sku;
	}

	public String getPaid() {
		return paid;
	}

	public void setPaid(String paid) {
		this.paid = paid;
	}

	public String getQuanity() {
		return quanity;
	}

	public void setQuanity(String quanity) {
		this.quanity = quanity;
	}

	@Override
	public String toString() {
		return "eBayInfo [orderId=" + orderId + ", buyerId=" + buyerId + ", orderStatus=" + orderStatus
				+ ", checkoutStatus=" + checkoutStatus + ", subTotal=" + subTotal + ", total=" + total + ", paymethod="
				+ paymethod + ", shiptime=" + shiptime + ", shiptype=" + shiptype + ", shipname=" + shipname
				+ ", shipAddress=" + shipAddress + ", postalCode=" + postalCode + ", phone=" + phone + ", createTime="
				+ createTime + ", transactionId=" + transactionId + ", productTitle=" + productTitle + ", itemId="
				+ itemId + ", sku=" + sku + ", paid=" + paid + ", quanity=" + quanity + "]";
	}

}
